package com.aaa.day117.demo2;

import java.time.*;
import java.util.Date;

/**
 * @Description:
 * @author:LiWei
 * @date:2022年11月07日9:46
 */
public class Test {
    public static void main(String[] args) {
        LocalDate localDate=LocalDate.of(2022,10,10);
        LocalDate now = LocalDate.now();

        Period period=Period.between(localDate, now);

        System.out.println("相差的年 = "+period.getYears());
        System.out.println("相差的月 = "+period.getMonths());
        System.out.println("相差的日 = "+period.getDays());

        LocalTime dateTime= LocalTime.of(2,4,1);
        LocalTime now1=LocalTime.now();
        Duration duration=Duration.between(dateTime,now1);
        System.out.println(duration.toHours());
        System.out.println(duration.toMinutes());
        System.out.println(duration.getSeconds());


    }
}
interface AAA{
    public void show();

    default void fun(){

    }
    static void fun1(){

    }
}